home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2874 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: chaos.kulnet.kuleuven.ac.be!usenet
  2. From: Andreas De Troy <andreas=de=troy%psl%pedcc3.kuleuven.ac.be>
  3. Newsgroups: comp.lang.c
  4. Subject: c
  5. Date: 24 Jan 1996 16:41:34 GMT
  6. Organization: KUL
  7. Message-ID: <4e5nfu$f4t@chaos.kulnet.kuleuven.ac.be>
  8. NNTP-Posting-Host: pcip194.psy.kuleuven.ac.be
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  13.  
  14. news:1996Jan24.144108.23883@river.tay.ac.uk
  15. insc2mb@river.tay.ac.uk (Mr persil) wrote:
  16. >I wonder if anyone can help.  I have written a program to add an word to the
  17. >end of a text file.  This text file was created using msdos editor.  The c
  18. >compiler is borland.  I try using the a and a+ modes to append to the end
  19. >of the file.  I used fprintf(text,word);  but this doesn't seem to add the
  20. >word to the file.  
  21. >
  22. >If anyone could help it would be greatly appreacite
  23. >
  24. Maybe your original file has an end-of-file marker (Ctrl Z, ASCII code 26 I 
  25. believe) as the last character. In that case fprintf (..) adds its 
  26. string beyond this EOF-marker and you will not see it in your editor, because 
  27. many editors stop reading their input as soon as they encounter 
  28. the EOF-marker. A binary dump of your textfile should reveal this (and look 
  29. at the filesize reported by "dir": it will be changed).
  30.  
  31. A file produced by (Borland) fprintf-statements does not have this 
  32. EOF-marker; but everytime you (edit the file and) save the file with your 
  33. editor, you will have this problem.
  34.  
  35.  
  36.